<div id="send_question_form">  
    <div class='header'>Send et spørgsmål til dette produkt</div>
    <div class='message'>
        <div class="pop-frm">
            <form action="">
                <div class="letf-side">
                    <label class="w70">Navn*:</label>
                    <input type="text" id="client_name"  class="txt_levering w200" name="client_name" /><br clear="left"/>
                    <label class="w70">Tlf:</label>
                    <input type="text" id="client_phone" class="txt_levering w200" name="client_phone" /><br clear="left" />
                    <label class="w70">Email*:</label>
                    <input type="text" id="client_email" class="txt_levering w200" name="client_email" /><br clear="left" />
                    <label class="w70">Skriv dit spørgsmål her*:</label>
                    <textarea id="client_comment" class="txt_levering w200 text_area" name="client_comment"></textarea><br clear="left" />
                    <input type="hidden" id="product_link" class="product_link" name="product_link" />
                </div>
                <div class="right-side datetime">                    
                    <p class="blue font14"><strong>Telefontider alle ugens 7 dage</strong></p>
                    <ul class="phone">
                        <li><span class="col1">Mandag – fredag</span><span class="col2">10.00-17-30</span></li>
                        <li><span class="col1">Lørdag</span><span class="col2">10.00-16.00</span></li>        
                        <li><span class="col1">Søndag</span><span class="col2">11.00-16.00</span></li>                                   
                    </ul>
                    <p><strong>Tlf. <span class="blue">4830 1699</span></strong></p>
                </div>
                <!--
                <div class="right-side">
                    <p class="font14 phone">
                        <strong>
                            Telefontider alle ugens dage fra kl. 11.00 - 16.00<br />
                            Tlf: <span class="blue">4830 1699</span>
                        </strong>
                    </p>                    
                </div>
                -->
                <div class="cb"></div>
                <input type="image" src="catalog/view/theme/<?php echo $template; ?>/images/bt_send.png" name="send" id="send_question_email" class="marl70" />
            </form>
        </div>  
        <div id="send_question_form_error" class="errorForm"></div>  
    </div>
    <!--
    <div class='buttons'>                 
        <div id="button_continue" class='continue'>Se valgte</div>
    </div>
    <br/>
    -->
</div>

<script type="text/javascript">
var mail_filter_qf = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z]{2,6})+$/;   
    
jQuery(document).ready(function(){
    //jQuery('#product_link').val(window.location.href);
    
    jQuery('#send_question_email').click(function(event){        
        event.preventDefault();
        
        var msg_qf = '';  
        var error = false;
         
        if(jQuery('#client_name').val() == ''){
            error = true;    
            jQuery('#client_name').addClass('errorField');     
            msg_qf = 'Ugyldigt navn';
        } 
        else{
            if(jQuery('#client_name').hasClass('errorField')){
                jQuery('#client_name').removeClass('errorField');     
            }
            error = false;
        }
        
        if(!error){
            if((jQuery('#client_email').val() == '') || !mail_filter_qf.test(jQuery('#client_email').val())){
                error = true;    
                jQuery('#client_email').addClass('errorField');     
                if(msg_qf == ''){
                    msg_qf = 'Indtast venligst en gyldig e-mail adresse';
                }           
            } 
            else{
                if(jQuery('#client_email').hasClass('errorField')){
                    jQuery('#client_email').removeClass('errorField');     
                }
                error = false;            
            }
        }
         
        if(!error){
            if(jQuery('#client_comment').val() == ''){
                error = true;    
                jQuery('#client_comment').addClass('errorField');     
                if(msg_qf == ''){
                    msg_qf = 'Ugyldigt "Skriv dit spørgsmål her"';
                }
            } 
            else{
                if(jQuery('#client_comment').hasClass('errorField')){
                    jQuery('#client_comment').removeClass('errorField');     
                }
                error = false;
            }
        }
                          
        if(error){
            jQuery('#send_question_form_error').html('<h3>' + msg_qf + '</h3>');
        }
        else {     
            jQuery('#send_question_form_error').html('');    
            
            jQuery.ajax({
                type: 'post',
                url: '<?php echo $send; ?>',
                dataType: 'html',
                data: {
                    'client_name': jQuery('#client_name').val(),  
                    'client_phone': jQuery('#client_phone').val(),                     
                    'client_email': jQuery('#client_email').val(),
                    'client_comment': jQuery('#client_comment').val(),                    
                    'product_link': jQuery('#product_link').val() 
                },
                success: function(html){
                    jQuery('#send_question_form .message').html('<h3 style="color:#000; font-weight:bold; text-transform:none;">' + html + '</h3>');
                },    
                complete: function(){
                }
            });                
        }
    });
})                                      
</script>